<template>
	<view class="">
		<view class="allbanner" style="position: relative;">
			<view class="bannercenter flexcolumn">
				<view class="bannerimgtext">
					<image src="@/static/image/system/f7xn.png" mode="" class=""></image>
				</view>
				<view class="bannertext3 margin_top">律师团队</view>
			</view>
			<image :src="topimg" mode=""></image>
		</view>
		<view class="mainpadding">
			<view class="shangj flexbetween allxiahian" v-for="item in list.data" :key="item.id" @click="ckxq(item.id)">
				<view class="shilitu">
					<image :src="item.logo_text" mode=""></image>
				</view>
				<view class="" style="width: 70%;">
					<view class="nostrongtext">{{item.name}}</view>
					<view class="nostrongtext margin_top1" v-if="item.is_rz==2">认证律师</view>
					<view class="nostrongtext margin_top1">从业时长:{{item.cysc}}</view>
					<view class="nostrongtext margin_top1 yhxk">擅长领域: {{item.scly}}</view>
					<view class="margin_top1 flexbetween">
						<view class="nostrongtext margin_top1">服务次数：{{Number(item.base_fw_num)+Number(item.fw_num)}}</view>
						<view class="lansetext">查看详情 > ></view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				topimg: "",
				page: 1,
				limit: 12,
				list: {
					data: [],
				},
			}
		},
		onLoad() {
			this.init()
			this.getbanner() //轮播
		},
		methods: {
			getbanner() {
				httpRequest.request('/api/index/getAdvertiseList', 'POST', {
					advertise_position_id: 22,
					is_more: 2
				}, false, false, true).then(res => {
					this.topimg = res.data.image_text
				})
			},
			init(isPage, page) {
				let _this = this;
				httpRequest.request("/api/index/shopIndex", 'GET', {
					page: page || 1,
					limit: _this.limit
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							_this.list = resList
							_this.list.data = resList.data;
						}
						this.pageshow = true
					}
					uni.hideLoading()
				}).catch(err => {
					uni.hideLoading()
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			// 查看律师详情
			ckxq(id) {
				uni.navigateTo({
					url: '/pages/index/lvshixq?id='+id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.lansetext {
		color: #4388bf;
		font-size: 24rpx;
		font-weight: 500;
	}

	.shilitu {
		width: 190rpx;
		height: 230rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.shangj {
		margin-top: 30rpx;
	}

	.shangj:first-child {
		margin-top: 0;
	}
</style>